package com.devunion.bogdan.view.project.actions;

import org.apache.log4j.Logger;

import javax.swing.*;
import java.awt.event.ActionEvent;

import com.devunion.bogdan.model.project.ProjectManager;
import com.devunion.bogdan.model.project.ProjectSavingException;
import com.devunion.bogdan.util.IconHelper;

class ViewProjectsBaseAction extends AbstractAction {
    private static Logger log = Logger.getLogger(ViewProjectsBaseAction.class);

    public ViewProjectsBaseAction() {
        super(null, IconHelper.getIcon("ViewProjectsBase48.gif"));
    }

    public void actionPerformed(ActionEvent e) {
        try {
            ProjectManager.getInstance().closeProject();
        } catch (ProjectSavingException e1) {
            log.error(e1.getMessage(), e1);
        }
    }
}
